package com.boho.system.action;

/**
 *
 * @File name:  GetSessionUserInfoAction.java   查询session用户信息
 * @Create on:  2010-05-10 19:19:218
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */     
            
import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.service.MessageService;

import com.boho.common.Constant;


public class GetSessionUserInfoAction extends ActionImp {
	@Override
	protected void doException(ActionContext atx, Exception ex) {
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		Object userID = atx.getSessionValue(Constant.SESSION_USER_NO);
		if(userID == null ){
			UserOperationException uoe = new UserOperationException();
			atx.setErrorContext("BOHO_COMMON_1010", MessageService.getMessage("BOHO_COMMON_1010"),uoe);
			throw uoe;
		}
		atx.setStringValue("SESSION_ID", userID.toString());
		atx.setObjValue("SESSION_BEAN", atx.getSessionValue(Constant.SESSION_USER_BEAN));
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		return 1;
	}
}
